:- use_module( library( clpfd ) ).
love :-
Alice = 1,
Bob = 2,
Carol = 3,
Dick = 4,
Edna = 5,
Vars = [Rose, Heart, Sun, Landscape, Deer, Priscilla, Rhonda, Quincy, Simon, Tina],	
Vars ins 1..5,
all_different([Alice,Bob,Carol,Dick,Edna]),
all_different([Rose,Heart,Sun,Landscape,Deer]),
all_different([Priscilla, Rhonda, Quincy, Simon, Tina]),
Alice + Bob + Carol + Dick + Edna #= 15,
Rose + Heart + Sun + Landscape + Deer #= 15,
Priscilla + Rhonda + Quincy + Simon + Tina #= 15,
label(Vars),
Carol #= Rose,
Dick #= Sun,
Bob #= Rhonda,
Bob #\= Landscape,
Alice #\= Priscilla,
Edna #= Quincy,
Tina #\= Deer,
Simon #= Deer,
Priscilla #\= Rose,
nl,
write([Alice, Bob, Carol, Dick, Edna]), nl,
write([Rose, Heart, Sun, Landscape, Deer]), nl,
write([Priscilla, Rhonda, Quincy, Simon, Tina]), nl.	

%setList([[Alice, Bob, Carol, Dick, Edna], [Rose, Heart, Sun, Landscape, Deer], [Priscilla, Rhonda, Quincy, Simon, Tina]]).


